<template>
  <div>
      <van-nav-bar class="app-nav-bar" title="异常处理列表" left-arrow @click-left="onClickLeft"/>
        <el-button class="btncolor" size="mini" type="success" @click="tj">异常处理新增</el-button>
        <el-table
        :data="tableData"
        style="width: 100%">
        <el-table-column
            prop="studentNo"
            label="学号">
        </el-table-column>
        <el-table-column width="50px"
            prop="className"
            label="班级">
        </el-table-column>
        <el-table-column
            prop="studentName"
            label="学生姓名">
        </el-table-column>
        <el-table-column
            prop="dorAddress"
            label="宿舍">
        </el-table-column>
        <el-table-column
            prop="status"
            label="处理状态">
            <template slot-scope="scope">
            <span style="margin-left:10px" v-if="scope.row.status ==='1'">联系不上</span>
            <span style="margin-left:10px" v-if="scope.row.status ==='2'">已联系上确认迟到</span>
            <span style="margin-left:10px" v-if="scope.row.status ==='3'">已联系上确认回家</span>
            <span style="margin-left:10px" v-if="scope.row.status ==='4'">已联系上确认擅自离校需进一步处理</span>

            </template>
        </el-table-column>
        <el-table-column label="操作">
            <template slot-scope="scope">
                <el-button size="mini" icon="el-icon-view" @click="ck( scope.row)"></el-button>
                <el-button size="mini" icon="el-icon-edit" @click="xg( scope.row)"></el-button>
                <el-button size="mini" icon="el-icon-delete" @click="del( scope.row)"></el-button>
            </template>
        </el-table-column>
        </el-table>
  </div>
</template>

<script>
export default {
data(){
        return{
            tableData:[],
            checkDate:"",
        }
    },
    methods:{
        tj(){
            this.$router.push({name: 'ExcAdd', params: { id: 2}})
        },    
        onClickLeft(){
            this.$router.go(-1) 
        },
        ck(row){
             this.$router.push({name: 'ExcDetail', params: { id: row.id}})
        },
        xg(row){
             this.$router.push({name: 'ExcEdit', params: { id: row.id}})
        },
        del(row){
             
        },
        async getUser(){
            console.log(this.checkDate);
            const {data:res} =await this.request("app/Attence/getAppExcList");
            console.log(res)
            this.tableData=res.data
        },
    },created(){
        this.getUser();
    }
}
</script>

<style>
.el-button+.el-button {
    margin-left: 0px !important;
}
</style>